package GUI;

import javax.swing.JButton;

import Joc.Joc;
import Joc.JocStates;


public class AStarCommand extends JButton implements Command {

	private static final long serialVersionUID = 1L;

	public AStarCommand() {
		super("Algoritm AStar");
	}

	public void execute() {
		SimulareDesenPanel.clearDesen();
		Joc j=Joc.getJocinstance();
		if (j.getState() == JocStates.PUZZLE) {
			SimulareDesenPanel.textdesen.append("Nimic!");
			MassagePanel.writeMessagePanel("Nimic!");
		}
		else if (j.getState() == JocStates.CANI) {
			MassagePanel.writeMessagePanel("NU poate fi aplicat algoritmul AStar!" );
		}
		else if (j.getState() == JocStates.LCV) {
			MassagePanel.writeMessagePanel("NU poate fi aplicat algoritmul AStar!" );
		}
		
	}

}
